//2009/07/17 13:02:23
//The same one in DIV2_550;
#include<iostream>
#include<vector>
using namespace std;

class CirclesCountry
{
	public:
	int leastBorders(vector <int> X, vector <int> Y, vector <int> R, int x1, int y1, int x2, int y2)
	{
		int count=0;
		for(int i=0; i < X.size(); i++)
		{
			if((distance(X[i],Y[i],x1,y1) < R[i] * R[i]) ^ (distance(X[i],Y[i],x2,y2) < R[i] * R[i]))
				count++;
		}
		return count;
	}
	private:
	int distance(int x1, int y1, int x2, int y2)
	{
		return (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
	}
};
